/*
 * 文件名：ParkwellPayBillController.java	 
 * 时     间：上午11:22:45
 * 作     者：Administrator       
 * 版     权： 2012-2022 湖南智软网络科技, 公司保留所有权利.
 * 联     系：http://www.073586.com/
 */
package com.local.controller.admin;

import java.text.SimpleDateFormat;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.cloud.otherThreads.UploadReportCarInfoRunble;
import com.cloud.threads.UploadAdminPayBillRunble;
import com.cloud.threads.UploadCouponRunble;
import com.cz073586.tools.util.ThreadPoolUtil;
import com.local.common.MessageContains;
import com.local.common.PayTypeConstans;
import com.local.dao.mapers.CarParkInMapper;
import com.local.dao.mapers.CarParkOutMapper;
import com.local.dao.mapers.LocalStationMapper;
import com.local.dao.mapers.ParklotNumberMapper;
import com.local.entity.vo.CarInManualOpenVo;
import com.local.entity.vo.ParklotVo;
import com.local.entity.vo.ParkwellPayBillVo;
import com.local.entity.vo.ReportCarInfoVo;
import com.local.entity.vo.ScreenMessage;
import com.local.entity.vo.TakePhotoParamVo;
import com.local.manager.cfgManager.CloudConfigManager;
import com.local.manager.cfgManager.reportConfigManager;
import com.local.manager.locks.RecordLockManager;
import com.local.manager.push.PushAdminRunble;
import com.local.manager.push.PushManualOpenCloudRunble;
import com.local.manager.push.PushParkLotRunble;
import com.local.manager.thread.CarParkOutThread;
import com.local.manager.thread.ParkTwoScreenMsgThread;
import com.local.manager.thread.ScreenLightThread;
import com.local.model.AdminCarInBill;
import com.local.model.AdminPayBill;
import com.local.model.CarParkIn;
import com.local.model.CarParkOut;
import com.local.model.LocalStation;
import com.local.model.Screen;
import com.local.page.AdminPayBillPage;
import com.local.service.face.AdminCarInBillService;
import com.local.service.face.AdminPayBillService;
import com.local.service.face.CarInAndOutService;
import com.local.service.face.CrossingService;
import com.local.service.face.LocalChargeByTimeCopyService;
import com.local.service.face.LocalCouponService;
import com.local.service.face.LocalParklotService;
import com.local.service.face.LocalScreenService;
import com.local.service.face.LogService;
import com.local.service.face.ParkwellCarOutService;
import com.local.service.face.ParkwellPayBillService;
import com.qianhai.common.constants.CommonContans;
import com.qianhai.common.controller.BaseController;
import com.qianhai.common.entity.LoginUserInfo;
import com.qianhai.common.exception.BaseException;
import com.qianhai.common.utils.ShiroUtil;
import com.qianhai.common.utils.Tools;
import com.qianhai.common.utils.UUIDGenerateUtil;

/**
 * 类描述:停车场支付流水
 * 
 * @ClassName: ParkwellPayBillController
 * @author Administrator
 * @date 2015年4月7日 上午11:22:45
 */
@RestController
@RequestMapping(value = "/admin/bill", method = RequestMethod.POST)
public class LocalAdminPayBillController extends BaseController
{
	
	@Autowired
	private LogService logService;
	@Autowired
	private ParkwellPayBillService parkwellPayBillService;
	
	@Autowired
	private AdminPayBillService adminPayBillService;
	
	@Autowired
	private LocalParklotService localParklotService;
	
	@Autowired
	private AdminCarInBillService adminCarInBillService;
	
	@Autowired
	private CarInAndOutService carInAndOutService;
	
	@Autowired
	private CrossingService crossingService;
	
	@Autowired
	private CarParkInMapper carInMapper;
	
	@Autowired
	private CarParkOutMapper caroutMapper;
	
	@Autowired
	private ParklotNumberMapper lotNumberMapper;
	
	@Autowired
	private ParkwellCarOutService carOutService;
	
	@Autowired
	private LocalStationMapper localStationMapper;
	
	@Autowired
	private LocalScreenService localScreenService;
	
	/**
	 * 
	 * 方法描述： 手动开启入场闸机
	 * 
	 * @Title: saveCarInBill
	 * @param @param parkwellPayBillVo
	 * @param @return
	 * @return ModelMap
	 * @user lyf 2015年9月26日
	 * @throws
	 */
	@RequestMapping(value = "/saveCarInBill.action", consumes = "application/json", produces = "application/json")
	@ResponseBody
	public ModelMap saveCarInBill(@RequestBody CarParkIn carParkIn)
	{
		ModelMap resultMap = new ModelMap();
		
		try
		{
			
			this.getLoginUser();
			if (carInAndOutService.selectCarIn(carParkIn) == 0)
			{
				// 添加进场流水
				carInAndOutService.addCarParkInBill(carParkIn);
			}
			AdminCarInBill adminCarInBill = new AdminCarInBill();
			adminCarInBill.setUuid(UUIDGenerateUtil.generate());
			adminCarInBill.setCarNo(carParkIn.getCarNo());
			SimpleDateFormat sd = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
			adminCarInBill.setInTime(sd.parse(carParkIn.getCarInTimeString()));
			adminCarInBill.setCrossingId(carParkIn.getCrossingId());
			adminCarInBill.setExchangeNo(carParkIn.getExchangeUuid());
			adminCarInBill.setLonginUserUuid(ShiroUtil.getCurrentUser()
					.getUuid());
			adminCarInBill.setStationUuid(carParkIn.getStationUuid());
			adminCarInBillService.addAdminCarInBill(adminCarInBill);
			
			resultMap.put(CommonContans.STRUTS_RESULT,
					CommonContans.STRUTS_SUCCESS);
			
		} catch (Throwable e)
		{
			// 请保持所有代码一直性，没有特殊处理请使用该代码.
			this.printExction(resultMap, e);
		}
		return resultMap;
	}
	
	/**
	 * 
	 * 方法描述： 手动开启出口闸机
	 * 
	 * @Title: savePayBill
	 * @param @param parkwellPayBillVo
	 * @param @return
	 * @return ModelMap
	 * @user lyf 2015年9月26日
	 * @throws
	 */
	@RequestMapping(value = "/savePayBill.action", consumes = "application/json", produces = "application/json")
	@ResponseBody
	public ModelMap savePayBill(@RequestBody ParkwellPayBillVo parkwellPayBillVo)
	{
		ModelMap resultMap = new ModelMap();
		
		try
		{
			
			LoginUserInfo loginUserInfo = this.getLoginUser();
			ScreenMessage screenMessage = new ScreenMessage();
			screenMessage.setHeadMsg("");
			screenMessage.setThirdMsg(MessageContains.GOOD_BYE_MSG);
			parkwellPayBillVo.setScreenMsg(screenMessage);
			if (Tools.isEmpty(parkwellPayBillVo.getCarOutUuid()))
			{
				throw new BaseException("50000-00001-00039");
			}
			
			// 2016-1-20 ，如果没有进场id,则强制开闸,纪录车牌号.
			if (Tools.isEmpty(parkwellPayBillVo.getCarInUuid()))
			{
				parkwellPayBillVo.setUserUuid(loginUserInfo.getUuid());
				parkwellPayBillVo.setUserName(loginUserInfo.getLoginName());
				// throw new BaseException("50000-00001-00049");
				AdminPayBill adminPayBill = carOutService
						.manualOpenCarOut(parkwellPayBillVo);
				
				if (CloudConfigManager.instance().isOpen())
				{
					UploadAdminPayBillRunble upload = new UploadAdminPayBillRunble(
							adminPayBill, logService);
					ThreadPoolUtil.instance().execute(upload);
				}
				ScreenLightThread screenLightThread = new ScreenLightThread(
						parkwellPayBillVo.getScreen());
				ThreadPoolUtil.instance().execute(screenLightThread);
				if (!Tools.isEmpty(parkwellPayBillVo.getScreenMsg()))
				{
					ParkTwoScreenMsgThread parkScreenMsgThread = new ParkTwoScreenMsgThread(
							parkwellPayBillVo.getScreenMsg(),
							parkwellPayBillVo.getScreen());
					ThreadPoolUtil.instance().execute(parkScreenMsgThread);
				}
				resultMap.put(CommonContans.STRUTS_RESULT,
						CommonContans.STRUTS_SUCCESS);
				return resultMap;
			}
			
			CarParkOut carParkOut = caroutMapper
					.selectByPrimaryKey(parkwellPayBillVo.getCarOutUuid());
			// 等待更新图片锁 2016-5-11
			if (!Tools.isEmpty(carParkOut)
					&& RecordLockManager.instance().isLocked(
							carParkOut.getRecordId()))
			{
				long carOutwaitTime = 0;
				while (RecordLockManager.instance().isLocked(
						carParkOut.getRecordId()))
				{
					carOutwaitTime += 1000;
					Thread.sleep(1000);
					if (log.isDebugEnabled())
					{
						log.debug("--->手动开闸主线程等待图片更新锁："
								+ Thread.currentThread().getId() + "，纪录ID"
								+ carParkOut.getRecordId());
					}
					if (carOutwaitTime >= 1000 * 60) // 一分钟后放弃
					{
						if (log.isDebugEnabled())
						{
							log.debug("--->手动开闸主线程等待图片更（放弃锁）：,线程ID："
									+ Thread.currentThread().getId() + "，纪录ID"
									+ carParkOut.getRecordId() + "，线程ID"
									+ Thread.currentThread().getId());
						}
						break;
					}
				}
			}
			// end 等待更新图片锁
			
			if (Tools.isEmpty(carParkOut))
			{
				throw new BaseException("50000-00001-00064");
			}
			carParkOut.setCarNo(parkwellPayBillVo.getCarNo());
			carParkOut.setStatus(0);
			carParkOut.setCarType(parkwellPayBillVo.getCarTypeUuid());
			carParkOut.setBrand(parkwellPayBillVo.getBillType());
			carParkOut.setAttr1(parkwellPayBillVo.getCarNoTye());
			
			if (!Tools.isEmpty(parkwellPayBillVo.getCarInUuid()))
			{
				if (Tools.isEmpty(parkwellPayBillVo.getPayType()))
				{
					parkwellPayBillVo.setPayType(PayTypeConstans.MONEY_TYPE);
				}
				// carOutService.createPayBill(parkwellPayBillVo, carParkOut);
			}
			
			if (parkwellPayBillVo.isError())
			{
				resultMap.put(CommonContans.STTURS_ERRORMSG,
						parkwellPayBillVo.getErrorMsg());
				resultMap.put(CommonContans.STRUTS_RESULT,
						CommonContans.STRUTS_ERROR);
				return resultMap;
			}
			
			// 打开闸机
			if (!Tools.isEmpty(carParkOut.getEquipment())
					&& !Tools.isEmpty(parkwellPayBillVo.getCarInUuid()))
			{
				// 解决中间件是否负载
				String middleIp = null;
				if (!Tools.isEmpty(parkwellPayBillVo.getStationUuid()))
				{
					LocalStation station = localStationMapper
							.selectByPrimaryKey(parkwellPayBillVo
									.getStationUuid());
					if (!Tools.isEmpty(station)
							&& !Tools.isEmpty(station.getStatus())
							&& station.getStatus() == 1)
					{
						middleIp = station.getEquipmentViewStream();
					}
				}
				try {
					crossingService.openGATE(parkwellPayBillVo.getRoadUuid(),
							parkwellPayBillVo
							.getStationUuid());
				} catch (Exception e) {
					log.error("50000-00001-00047", e);
				}
				/*PushAdminRunble openRunble = new PushAdminRunble(
						new AdminPayBill(), null, carParkOut.getEquipment(),
						middleIp);
				ThreadPoolUtil.instance().execute(openRunble);*/
				// 自动开闸，插入出场数据并拷贝到出场副本表、删除进场记录表（拷贝到副本），删除计费副本、打印流水、上传到云、推送车位数、推送前端
				parkwellPayBillVo.setUserUuid(loginUserInfo.getUuid());
				parkwellPayBillVo.setUserName(loginUserInfo.getLoginName());
				CarParkOutThread carOutRunble = new CarParkOutThread(
						carOutService, parkwellPayBillVo, carParkOut,
						carInMapper, lotNumberMapper, logService,
						carInAndOutService, crossingService);
				/* carParkOutService.carOutNew(parkwellPayBillVo, carParkOut); */
				ThreadPoolUtil.instance().execute(carOutRunble);
				if (!Tools.isEmpty(screenMessage))
				{
					Screen screen = localScreenService
							.queryScreenByCarOutUuid(parkwellPayBillVo
									.getCarOutUuid());
					ParkTwoScreenMsgThread parkScreenMsgThread = new ParkTwoScreenMsgThread(
							screenMessage, screen);
					ThreadPoolUtil.instance().execute(parkScreenMsgThread);
				}
			}
			
			/*
			 * // 出场,保证闸机开启后删除数据,推送车位数据量
			 * carOutService.copyToOhterTable(carParkOut.getUuid(),
			 * parkwellPayBillVo.getCarInUuid());
			 * 
			 * // 出场 if (CloudConfigManager.instance().isOpen()) {
			 * UpDateCarOutInfoRunble upload = new UpDateCarOutInfoRunble(
			 * carParkOut, logService);
			 * ThreadPoolUtil.instance().execute(upload); }
			 * 
			 * // 上传纸质优惠券 if (CloudConfigManager.instance().isOpen() &&
			 * !Tools.isEmpty(parkwellPayBillVo.getLcoupon())) {
			 * UploadCouponRunble upload = new UploadCouponRunble(
			 * parkwellPayBillVo.getLcoupon(), logService);
			 * ThreadPoolUtil.instance().execute(upload); }
			 * 
			 * // 上传流水 if (CloudConfigManager.instance().isOpen() &&
			 * !Tools.isEmpty(parkwellPayBillVo.getPayBill())) {
			 * UploadPayBillRunble upload = new UploadPayBillRunble(
			 * parkwellPayBillVo.getPayBill(), logService);
			 * ThreadPoolUtil.instance().execute(upload); }
			 * 
			 * // 生成的流水，同步到云平台 if (CloudConfigManager.instance().isOpen()) { for
			 * (LocalPayBill cnpBill : parkwellPayBillVo
			 * .getCouponToPayBillsList()) { UploadPayBillRunble upload = new
			 * UploadPayBillRunble( cnpBill, logService);
			 * ThreadPoolUtil.instance().execute(upload); }
			 * 
			 * // 使用的商家电子优惠劵记录，上传到云系统，并修改使用状态 for (LocalCouponCash lc :
			 * parkwellPayBillVo.getLscList()) { UpDateCouponCashRunble upload =
			 * new UpDateCouponCashRunble( lc, logService);
			 * ThreadPoolUtil.instance().execute(upload); } }
			 */
			
			resultMap.put(CommonContans.STRUTS_RESULT,
					CommonContans.STRUTS_SUCCESS);
			
		} catch (Throwable e)
		{
			// 请保持所有代码一直性，没有特殊处理请使用该代码.
			this.printExction(resultMap, e);
		} finally
		{
			if (parkwellPayBillVo.isError())
			{
				resultMap.put(CommonContans.STTURS_ERRORMSG,
						parkwellPayBillVo.getErrorMsg());
				resultMap.put(CommonContans.STRUTS_RESULT,
						CommonContans.STRUTS_ERROR);
			}
		}
		return resultMap;
	}
	
	/**
	 * 
	 * 方法描述：中央收费，仅生成流水。（出场时，自动判断流水，开闸）
	 * 
	 * @Title: savePayBillCentral
	 * @param @param parkwellPayBillVo
	 * @param @return
	 * @return ModelMap
	 * @user Administrator 2016年4月20日
	 * @throws
	 */
	@RequestMapping(value = "/savePayBillCentral.action", consumes = "application/json", produces = "application/json")
	@ResponseBody
	public ModelMap savePayBillCentral(
			@RequestBody ParkwellPayBillVo parkwellPayBillVo)
	{
		ModelMap resultMap = new ModelMap();
		
		try
		{
			
			LoginUserInfo loginUserInfo = this.getLoginUser();
			
			if (Tools.isEmpty(parkwellPayBillVo.getCarOutUuid()))
			{
				throw new BaseException("50000-00001-00039");
			}
			
			CarParkOut carParkOut = caroutMapper
					.selectByPrimaryKey(parkwellPayBillVo.getCarOutUuid());
			
			if (Tools.isEmpty(carParkOut))
			{
				throw new BaseException("50000-00001-00064");
			}
			carParkOut.setCarNo(parkwellPayBillVo.getCarNo());
			
			if (!Tools.isEmpty(parkwellPayBillVo.getCarInUuid()))
			{
				if (Tools.isEmpty(parkwellPayBillVo.getPayType()))
				{
					parkwellPayBillVo.setPayType(PayTypeConstans.MONEY_TYPE);
				}
				// carOutService.createPayBill(parkwellPayBillVo, carParkOut);
			}
			
			if (parkwellPayBillVo.isError())
			{
				resultMap.put(CommonContans.STTURS_ERRORMSG,
						parkwellPayBillVo.getErrorMsg());
				resultMap.put(CommonContans.STRUTS_RESULT,
						CommonContans.STRUTS_ERROR);
				return resultMap;
			}
			
			// 生成流水运行表
			if (!Tools.isEmpty(parkwellPayBillVo.getCarInUuid()))
			{
				parkwellPayBillVo.setUserUuid(loginUserInfo.getUuid());
				parkwellPayBillVo.setUserName(loginUserInfo.getLoginName());
				parkwellPayBillService.saveCentralPayBill(parkwellPayBillVo);
			} else
			{
				throw new BaseException("50000-00001-00067");
			}
			resultMap.put(CommonContans.STRUTS_RESULT,
					CommonContans.STRUTS_SUCCESS);
			
		} catch (Throwable e)
		{
			// 请保持所有代码一直性，没有特殊处理请使用该代码.
			this.printExction(resultMap, e);
		} finally
		{
			if (CloudConfigManager.instance().isOpen()
					&& !Tools.isEmpty(parkwellPayBillVo.getLcoupon()))
			{
				UploadCouponRunble upload = new UploadCouponRunble(
						parkwellPayBillVo.getLcoupon(), logService);
				ThreadPoolUtil.instance().execute(upload);
			}
			if (parkwellPayBillVo.isError())
			{
				resultMap.put(CommonContans.STTURS_ERRORMSG,
						parkwellPayBillVo.getErrorMsg());
				resultMap.put(CommonContans.STRUTS_RESULT,
						CommonContans.STRUTS_ERROR);
			}
		}
		return resultMap;
	}
	
	/**
	 * 
	 * 方法描述： 管理员强制开闸
	 * 
	 * @Title: forcePayBill
	 * @param @param adminPayBill
	 * @param @return
	 * @return ModelMap
	 * @user lyf 2015年9月26日
	 * @throws
	 */
	@RequestMapping(value = "/forcePayBill.action", consumes = "application/json", produces = "application/json")
	@ResponseBody
	public ModelMap forcePayBill(@RequestBody AdminPayBill adminPayBill)
	{
		ModelMap resultMap = new ModelMap();
		
		try
		{
			adminPayBill.setLonginUserUuid(this.getLoginUser().getUuid());
			adminPayBillService.addAdminPayBill(adminPayBill);
			
			if (CloudConfigManager.instance().isOpen())
			{
				UploadAdminPayBillRunble upload = new UploadAdminPayBillRunble(
						adminPayBill, logService);
				ThreadPoolUtil.instance().execute(upload);
			}
			
			resultMap.put(CommonContans.STRUTS_RESULT,
					CommonContans.STRUTS_SUCCESS);
			
		} catch (Throwable e)
		{
			// 请保持所有代码一直性，没有特殊处理请使用该代码.
			this.printExction(resultMap, e);
		}
		return resultMap;
	}
	
	/**
	 * 
	 * 方法描述： 车辆进场手动开闸
	 * 
	 * @Title: carInManualOpen
	 * @param @param carinUUid
	 * @param @return
	 * @return ModelMap
	 * @user lyf 2015年11月5日
	 * @throws
	 */
	@RequestMapping(value = "/carInManualOpen.action", consumes = "application/json", produces = "application/json")
	@ResponseBody
	public ModelMap carInManualOpen(@RequestBody CarInManualOpenVo vo)
	{
		ModelMap resultMap = new ModelMap();
		
		try
		{
			getLoginUser();
			AdminCarInBill adminCarInBill = new AdminCarInBill();
			adminCarInBill.setStationUuid(vo.getStationUuid());
			adminPayBillService.carInManualOpen(vo, adminCarInBill);
			
			// 确认闸机已经开启
			if (!Tools.isEmpty(adminCarInBill.getAttr2())
					&& adminCarInBill.getAttr2().equals("true"))
			{
				ScreenMessage screenMessage = new ScreenMessage();
				screenMessage.setHeadMsg(vo.getCarNo().equals("无效车牌")?"":vo.getCarNo());
				screenMessage.setThirdMsg(MessageContains.WELCOM_MSG);
				vo.setScreenMsg(screenMessage);
				if (!Tools.isEmpty(vo.getScreenMsg()))
				{
					ParkTwoScreenMsgThread parkScreenMsgThread = new ParkTwoScreenMsgThread(
							vo.getScreenMsg(),
							vo.getScreen());
					ThreadPoolUtil.instance().execute(parkScreenMsgThread);
					log.debug("发送进场语音消息-------------------结束");
				}
				ScreenLightThread screenLightThread = new ScreenLightThread(
						vo.getScreen());
				ThreadPoolUtil.instance().execute(screenLightThread);
				// 推送总车位数
				PushParkLotRunble lotRunbile = new PushParkLotRunble(
						carInMapper, lotNumberMapper);
				ThreadPoolUtil.instance().execute(lotRunbile);
				
				// 同步到云平台
				if (CloudConfigManager.instance().isOpen())
				{
					PushManualOpenCloudRunble cloudRunbile = new PushManualOpenCloudRunble(
							adminCarInBill, vo, carInAndOutService);
					ThreadPoolUtil.instance().execute(cloudRunbile);
				}
				
				// 上报车辆进出场，信息
				if (reportConfigManager.instance().isOpen())
				{
					// 上报系统，转换
					ReportCarInfoVo reportCarInfoVo = carInAndOutService
							.ReportCarInfoVoIn(vo.getCarInInfo());
					
					UploadReportCarInfoRunble report = new UploadReportCarInfoRunble(
							reportCarInfoVo, logService);
					ThreadPoolUtil.instance().execute(report);
				}
			}
			
			resultMap.put(CommonContans.STRUTS_RESULT,
					CommonContans.STRUTS_SUCCESS);
			
		} catch (Throwable e)
		{
			// 请保持所有代码一直性，没有特殊处理请使用该代码.
			this.printExction(resultMap, e);
		}
		return resultMap;
	}
	
	@RequestMapping(value = "/carInManualUpdate.action", consumes = "application/json", produces = "application/json")
	@ResponseBody
	public ModelMap carInManualUpdate(@RequestBody CarParkIn carParkIn)
	{
		ModelMap resultMap = new ModelMap();
		try
		{
			carInAndOutService.updateCarNo(carParkIn);
			resultMap.put(CommonContans.STRUTS_RESULT,
					CommonContans.STRUTS_SUCCESS);
		} catch (Exception e)
		{
			// 请保持所有代码一直性，没有特殊处理请使用该代码.
			this.printExction(resultMap, e);
		}
		return resultMap;
	}
	
	/**
	 * 
	 * 方法描述： 指定设备进行抓拍
	 * 
	 * @Title: takePhoto
	 * @param @param equmentNo
	 * @param @return
	 * @return ModelMap
	 * @user lyf 2015年10月20日
	 * @throws
	 */
	@RequestMapping(value = "/takePhoto.action", consumes = "application/json", produces = "application/json")
	@ResponseBody
	public ModelMap takePhoto(@RequestBody TakePhotoParamVo vo)
	{
		ModelMap resultMap = new ModelMap();
		
		try
		{
			
			crossingService.takePhoto(vo);
			resultMap.put(CommonContans.STRUTS_RESULT,
					CommonContans.STRUTS_SUCCESS);
			
		} catch (Throwable e)
		{
			// 请保持所有代码一直性，没有特殊处理请使用该代码.
			this.printExction(resultMap, e);
		}
		return resultMap;
	}
	
	@RequestMapping(value = "/loadCarFree.action", consumes = "application/json", produces = "application/json")
	@ResponseBody
	public ModelMap loadCarFree()
	{
		ModelMap resultMap = new ModelMap();
		
		try
		{
			ParklotVo parklotVo = localParklotService.loadCarFree();
			resultMap.put(CommonContans.STRUTS_DATA, parklotVo);
			resultMap.put(CommonContans.STRUTS_RESULT,
					CommonContans.STRUTS_SUCCESS);
			
		} catch (Throwable e)
		{
			// 请保持所有代码一直性，没有特殊处理请使用该代码.
			this.printExction(resultMap, e);
		}
		return resultMap;
	}
	
	@RequestMapping(value = "/payBillAll.action", consumes = "application/json", produces = "application/json")
	@ResponseBody
	public ModelMap payBillAll(
			@RequestBody AdminPayBillPage<AdminPayBill> pageInfo)
	{
		ModelMap resultMap = new ModelMap();
		
		try
		{
			adminPayBillService.queryAdminPayBillByPage(pageInfo);
			resultMap.put(CommonContans.STRUTS_DATA, pageInfo);
			resultMap.put(CommonContans.STRUTS_RESULT,
					CommonContans.STRUTS_SUCCESS);
		} catch (Throwable e)
		{
			// 请保持所有代码一直性，没有特殊处理请使用该代码.
			this.printExction(resultMap, e);
		}
		return resultMap;
	}
	
}
